<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Step 4: Configuring Log Backup">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="en-us_topic_0000002164668662.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="">
  <meta name="DC.Publisher" content="20250306">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="EN-US_TOPIC_0000002164828462">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Step 4: Configuring Log Backup</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="EN-US_TOPIC_0000002164828462"></a><a name="EN-US_TOPIC_0000002164828462"></a>
  <h1 class="topictitle1">Step 4: Configuring Log Backup</h1>
  <div>
   <p>If log backup is configured in <a href="en-us_topic_0000002164828382.html">Step 5: Creating a Backup SLA</a>, enable log backup for the SAP HANA database by following the instructions provided in this section for log backup to take effect. Skip this section in other scenarios.</p>
   <div class="section">
    <h4 class="sectiontitle">Context</h4>
    <p>The SAP HANA database log backup function provided by the <span>product</span> depends on the log backup capability of SAP HANA. After SAP HANA logs are backed up, they are backed up to the backup storage by the <span>product</span>.</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">Procedure</h4>
    <ol>
     <li><span>Log in to the system database.</span><p></p>
      <ol type="a">
       <li>Use PuTTY to log in to the SAP HANA database host.</li>
       <li>Run the following command to switch to the SAP system user:<pre class="screen">su - <em>&lt;sid&gt;</em>adm</pre> <p>In the preceding command, <em>sid</em> indicates the SAP system ID. For example:</p> <pre class="screen">su - s00adm</pre></li>
       <li>Run the following command to log in to the system database:<pre class="screen">hdbsql -i <em>Instance ID</em> -n <em>Host name of the active node of the system database</em><strong>:</strong><em>SQL port of the system database</em><strong> -d SYSTEMDB -u </strong><em>Username of the system database</em><strong> -p </strong><em>Password of the system database</em></pre> <p>Example:</p> <pre class="screen">hdbsql -i 00 -n localhost:30013 -d SYSTEMDB -u SYSTEM -p xxxxxxx</pre></li>
      </ol> <p></p></li>
    </ol>
    <ol start="2">
     <li id="EN-US_TOPIC_0000002164828462__li1684818481011"><a name="EN-US_TOPIC_0000002164828462__li1684818481011"></a><a name="li1684818481011"></a><span>Enable and configure the log backup function.</span><p></p>
      <ol type="a">
       <li>Run the following command to enable SAP HANA database log backup:<pre class="screen">alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', 'enable_auto_log_backup') = 'yes' with reconfigure;</pre></li>
       <li>Run the following command to set the directory for storing log backup copies.
        <div class="p">
         Ensure that the available space of the directory for storing log backup copies is greater than the space to be occupied by all log backup copies, and that the SAP HANA log backup path permissions are at least 755. In addition, the directory for storing log backup copies must be a shared directory.
         <div class="notice">
          <span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span>
          <div class="noticebody">
           <p>The value of <em>Directory for storing log backup copies</em> set by running the following commands must be the same. Otherwise, the log backup job will fail.</p>
          </div>
         </div>
         <pre class="screen">alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', 'basepath_logbackup') = '<em>Directory for storing log backup copies</em>' with reconfigure;
alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', 'basepath_catalogbackup') = '<em>Directory for storing log backup copies</em>' with reconfigure;</pre>
        </div>
        <div class="note">
         <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
         <div class="notebody">
          <div class="p">
           To query the shared directory, perform the following steps:
           <ol id="EN-US_TOPIC_0000002164828462__ol191671738121118">
            <li id="EN-US_TOPIC_0000002164828462__li51671838151120">Use PuTTY to log in to the host where the SAP HANA database is located as user <strong id="EN-US_TOPIC_0000002164828462__b36143819186">root</strong>.</li>
            <li id="EN-US_TOPIC_0000002164828462__li1411414546215"><a name="EN-US_TOPIC_0000002164828462__li1411414546215"></a><a name="li1411414546215"></a>Run the following command to switch to the SAP system user:<pre class="screen" id="EN-US_TOPIC_0000002164828462__screen148394565408">su - <em id="EN-US_TOPIC_0000002164828462__i462684119271">&lt;sid&gt;</em>adm</pre> <p id="EN-US_TOPIC_0000002164828462__p10839195616407">In the preceding command, <em id="EN-US_TOPIC_0000002164828462__i128711110122113">sid</em> indicates the SAP system ID. For example:</p> <pre class="screen" id="EN-US_TOPIC_0000002164828462__screen1839115644015">hana1:~ # su - s00adm
s00adm@hana1:/usr/sap/S00/HDB00&gt; </pre> <p id="EN-US_TOPIC_0000002164828462__p195411748132413">In the command output, <strong id="EN-US_TOPIC_0000002164828462__b19355113322115">/usr/sap/S00/HDB00</strong> is the soft link of the SAP system user directory.</p></li>
            <li id="EN-US_TOPIC_0000002164828462__li1216811387113">Run the following command to check the actual direction of the SAP system user directory and obtain the shared directory of SAP HANA:<pre class="screen" id="EN-US_TOPIC_0000002164828462__screen7168123818112">ll <em id="EN-US_TOPIC_0000002164828462__i639144710283">usr_Directory</em> </pre> <p id="EN-US_TOPIC_0000002164828462__p22102495165">In the preceding command, <em id="EN-US_TOPIC_0000002164828462__i13389183782317">usr_Directory</em> indicates the soft link path obtained in <a href="#EN-US_TOPIC_0000002164828462__li1411414546215">2.b.ii</a>. For example:</p> <pre class="screen" id="EN-US_TOPIC_0000002164828462__screen124041114175">s00adm@hana1:/usr/sap/S00/HDB00&gt; ll /usr/sap/S00
total 4
lrwxrwxrwx 1 s00adm sapsys  27 Dec 11 09:41 HDB00 -&gt; /home/hana/shared/K00/HDB00
drwxr-x--- 1 s00adm sapsys  38 Dec 11 09:48 hdblcm_uploads
drwxr-xr-x 1 s00adm sapsys 338 Dec 11 09:44 home
drwxr-x--- 1 s00adm sapsys  32 Dec 11 09:39 SYS</pre> <p id="EN-US_TOPIC_0000002164828462__p14534259172819">In the command output, the upper level of the <strong id="EN-US_TOPIC_0000002164828462__b34881648102612">shared</strong> directory is <strong id="EN-US_TOPIC_0000002164828462__b853063715265">/home/hana</strong>, which the shared directory of SAP HANA.</p></li>
           </ol>
          </div>
         </div>
        </div></li>
       <li>Run the following command to set the log backup frequency, that is, the interval for backing up logs:<pre class="screen">alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', 'log_backup_timeout_s') = '<em>Log backup interval</em><em>(s)</em>' with reconfigure;</pre> <p>It is recommended that the interval be set to 50% to 100% of the log backup interval set in <a href="en-us_topic_0000002164828382.html#EN-US_TOPIC_0000002164828382__en-us_topic_0000002058628320_en-us_topic_0000002004293194_en-us_topic_0000002004090332_en-us_topic_0000001839268545_table2663151516335">Table 1</a>. For example, if the log backup interval set in the backup policy is 60 minutes, you are advised to set the interval to a value ranging from 30 minutes to 60 minutes.</p></li>
      </ol> <p></p></li>
    </ol>
   </div>
   <p></p>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="en-us_topic_0000002164668662.html">Backing Up the SAP HANA Database (General Databases Path)</a>
    </div>
   </div>
  </div>
 </body>
</html>